package com.hrt.demo.fannie.bean;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;


@Entity
@Table(name="Demo_PRODUCT")
//@JsonIgnoreProperties(value = { "classification"})
public class Products implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "DP_ID",nullable = false)
	private Long id;
	
	@Column(name = "DP_NAME")
	private String name;
	
//	@Column(name = "DP_PIC")
//	private String pic;
	/**
	 *  大字段；商品详情
	 */
	@Lob
    @Column(name = "DP_PIC", columnDefinition = "BLOB")
	private byte[] pic;
	
	@Transient
	private String pic_str;
	
	@Column(name = "DEMO_CLAISDELETE")//是否删除
	private Integer isdelete=0;
	
	
	@ManyToOne(cascade = {CascadeType.REFRESH,CascadeType.MERGE},optional = false)
	@JoinColumn(name = "DEMO_ID")
	private Classification classification;//分类
	
	
	public Products() {
	}
	
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	public byte[] getPic() {
		return pic;
	}
	public void setPic(byte[] pic) {
		this.pic = pic;
	}

	public String getPic_str() {
		return pic_str;
	}
	public void setPic_str(String pic_str) {
		this.pic_str = pic_str;
	}

	public Classification getClassification() {
		return classification;
	}
	public void setClassification(Classification classification) {
		this.classification = classification;
	}

	public Integer getIsdelete() {
		return isdelete;
	}

	public void setIsdelete(Integer isdelete) {
		this.isdelete = isdelete;
	}

	/*public Long getClassId() {
		return classId;
	}

	public void setClassId(Long classId) {
		this.classId = classId;
	}
	*/
}
